﻿using System;

using BizElements.Core;
using BizElements.Core.ProviderComponents;

namespace BizElements.Core.MySql
{
    sealed class MySqlParameterRenderer : IParameterRenderer
    {
        #region RenderParameterName - parameter names are prefixed by '@' character.

        public string RenderParameterName(DbParameter parameter)
        {
            return "@" + parameter.ParameterName;
        }

        #endregion

        #region GetUniqueName - index is appended to original/initial parameter name.

        public string GetUniqueName(string originalParameterName, int parameterIndexInCollection)
        {
            return originalParameterName + "_" + parameterIndexInCollection;
        }

        #endregion
    }
}